package com.gimi.cloud.jimi.dao.dao.order;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.gimi.cloud.jimi.dao.dao.sys.BaseDao;
import com.gimi.cloud.jimi.dao.myMapper.MyMapper;
import com.gimi.cloud.jimi.dto.order.OrderCostDTO;
import com.gimi.cloud.jimi.entity.order.OrderCostEntity;
/**
 * 订单操作信息dao
 * @author chendi
 * @date 2018年1月10日
 */
@Mapper
public interface OrderCostDao extends MyMapper<OrderCostEntity>,BaseDao{

	@Update("UPDATE sh_order_cost SET is_delete = 1 WHERE o_id = #{oId}")
	int deleteByOrderId(@Param(value = "oId")Integer oId);
	
	@Select("SELECT * FROM sh_order_cost WHERE is_delete = 0 AND o_id = #{oId}")
	List<OrderCostDTO> selectOrderCostByOrder(@Param(value = "oId") Integer oId);

	@Select("SELECT * FROM sh_order_cost WHERE  order_code = #{orderCode} limit 1")
	OrderCostEntity selectOrderCostByOrderCode(@Param(value = "orderCode") String orderCode);
}


